/** 
 * ---------------------------------------------------------------------------------------------------------------
 * @Copyright	Quadrangle Systems Inc.
 * @Title		RequestBase.java   
 * @author 		Peak Zhang
 * @date 		2014-07-11
 * @Description: 
 *				Base bean for requesting services
 * ---------------------------------------------------------------------------------------------------------------
 */ 
package com.qs.education.bean.api;

import java.io.UnsupportedEncodingException;

import com.fasterxml.jackson.annotation.JsonIgnore;
import com.qs.education.bean.utils.JsonUtil;



/**
 * @class RequestBase
 * @author Brooks
 * @description 所有request bean的父类,把bean转换成Json字符串
 * @date Oct 24, 2018
 */
public abstract class RequestBase {

	@JsonIgnore
	public byte[] getJsonByte(){
		try {
			return JsonUtil.beanToJson(this).getBytes("utf-8");
		} catch (UnsupportedEncodingException e) {
			// TODO Auto-generated catch block
			e.printStackTrace();
			return null;
		}
	}

	@JsonIgnore
	public String getJsonString(){
		return JsonUtil.beanToJson(this);
	}
}
